package com.example.demo.handler;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.dto.MainTheaterDto;
import com.example.demo.service.MainTheaterService;
import com.woniuxy.movice.entity.MainTheater;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api("总影院管理")
@RestController
@RequestMapping("/main")
public class MainTheaterController {
	
	@Resource
	private MainTheaterService mainTheaterService;
	
	@ApiOperation(value="获得所有已认证总影院",notes="返回所有已认证影院")
    @RequestMapping(value="/getAllTheaterR",method=RequestMethod.GET)
    public List<MainTheaterDto> getAllTheaterR(){
        return mainTheaterService.getAllTheaterR();
    }
	
	@ApiOperation(value="获得所有未认证总影院",notes="返回所有未认证影院")
    @RequestMapping(value="/getAllTheaterW",method=RequestMethod.GET)
    public List<MainTheaterDto> getAllTheaterW(){
        return mainTheaterService.getAllTheaterW();
    }
	
	@ApiOperation(value="认证总影院",notes="返回认证结果，(int) zid (int) 套餐时长")
    @RequestMapping(value="/PassTheater",method=RequestMethod.POST)
    public String PassTheater(int zid, int tyear){
        return mainTheaterService.PassTheater(zid, tyear);
    }
	
	@ApiOperation(value="拒绝总影院认证",notes="返回拒绝结果，(int) zid")
    @RequestMapping(value="/RefuseTheater",method=RequestMethod.POST)
    public String RefuseTheater(int zid){
        return mainTheaterService.RefuseTheater(zid);
    }
	
	@ApiOperation(value="总影院续费",notes="返回续费结果，(int) zid (int) 套餐时长")
    @RequestMapping(value="/addTime",method=RequestMethod.POST)
    public String addTime(int zid, int tyear){
        return mainTheaterService.addTime(zid, tyear);
    }
}
